drawnHistogram <- function(nameHist)
{
  fileName <- file.choose()
  data <- read.table(fileName)
  
  n = nrow(data)
  m = ncol(data)
  
  array <- c()
  #is.integer(array)
  pos = 0
  
  for(i in 1:n)
  {
    for(j in 1:m)
    {
      pos = pos + 1
      array[pos] = data[i,j]
    }
  }
  hist(array,col="lightblue",xlab="Color-values",ylab="Count",main=paste("Histogram", nameHist, sep=" ") ,breaks = seq(0,max(array),by = 1),xlim=c(0,270),xaxt="n",yaxt="n")
  axis(1, at=seq(0 , 256, by=4), lwd=0, lwd.ticks=1)
  axis(2, at=seq(0 , m*n, by=250), lwd=0, lwd.ticks=1)
  axis(1, at=c(0,256), labels=c("",""), lwd.ticks=0)
  axis(2, at=c(0,m*n), labels=c("",""), lwd.ticks=0)

}



drawnHistogram("of Red color")
drawnHistogram("of Blue color")
drawnHistogram("of Green color")
drawnHistogram("of GreyScale color")
